$(document).ready(function(){
    //分销商用户信息
    dissUserinfo()
    
})


function dissUserinfo(){
    mzpost({
        url:pub_userinfo,
        data:{},
        success:function(res){
            if(res.code == '2000'){
                var data = res.data;
               
                $('#name').text(data.nickname);
                $('#account').text(data.tel);
                $('#accountinput').val(data.tel);
                $('#yjze').text('￥'+data.rake_money);

                var news = data.news;
                if(location.href.indexOf('/distributor/index.html') == -1){
                    return;
                }
                $('#newslunbo').empty();
                if(news instanceof Array && news.length > 0){
                    $.each(news,function(i,item){
                        $('<a href="./newsdetail/index.html?id='+item.id+'" class="lunbo-item">'+item.title+'</a>').appendTo('#newslunbo')
                     })
                     setInterval(function () {
                        goupAll('#newslunbo','-30px');
                    },10000);
                }
            }else{
                mui.toast('获取用户信息失败');
            }
        },
        error:function(err){
            mui.toast('获取用户信息错误');
        }
    })
}